; chapter3 exercise5
(setf L '(7 5 1 4))

; 迭代版本
(defun pos+it (lst)
	(let ((i 0) (new-lst nil))
		(dolist (obj lst)
			(progn (setf new-lst (append new-lst (list (+ i obj))))
						 (setf i (+ i 1))))
		new-lst))


; recursive 版本
(defun pos+r (lst)
	(pos+r-real lst 0))

(defun pos+r-real (lst pos)
	(if (null lst)
		nil
		(cons (+ (car lst) pos) (pos+r-real (cdr lst) (+ 1 pos)))))


;mapcar 版本
(defun pos+mapcar (lst)
	(let ((i -1))
		(mapcar (lambda (obj)
							(progn (setf i (+ 1 i))
										 (+ obj i)))
						lst)))
